home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
AOL File Library: 2,801 to 2,900
/
aol-file-protocol-4400-2801-to-2900.zip
/
AOLDLs
/
C++ Files Library
/
Point_Rect C++ Classes
/
MacObj.sit
/
MacObj ƒ
/
CRect.cp
< prev
next >
Wrap
Text File
|
1993-09-11
|
3KB
|
107 lines
#ifdef _MACOBJ_SPEED
#define _MACOBJ_INLINE inline
#else
#define _MACOBJ_INLINE
#include "CRect.h"
#endif
_MACOBJ_INLINE CRect::CRect()
{ }
_MACOBJ_INLINE CRect::CRect(short l, short t, short r, short b)
{ top = t; left = l; bottom = b; right = r; }
_MACOBJ_INLINE CRect::CRect(const Rect& r)
{ *(Rect*)this = r; }
_MACOBJ_INLINE void CRect::SetRect(short left, short top, short right, short bottom)
{ ::SetRect(this, left, top, right, bottom); }
_MACOBJ_INLINE void CRect::SetRectEmpty()
{ ::SetRect(this,0,0,0,0); };
_MACOBJ_INLINE void CRect::InsetRect(short x, short y)
{ ::InsetRect(this,x,y); }
_MACOBJ_INLINE void CRect::OffsetRect(short x, short y)
{ ::OffsetRect(this,x,y); }
_MACOBJ_INLINE void CRect::OffsetRect(Point p)
{ ::OffsetRect(this, p.h, p.v); }
_MACOBJ_INLINE Boolean CRect::PtInRect(Point p)
{ return ::PtInRect(p, this); }
_MACOBJ_INLINE Boolean CRect::EmptyRect() const
{ return ::EmptyRect(this); }
_MACOBJ_INLINE Boolean CRect::NullRect() const
{ return (top == 0 && left == 0 &&
bottom == 0 && right == 0); }
_MACOBJ_INLINE short CRect::Height(void)
{ return bottom - top; }
_MACOBJ_INLINE short CRect::Width(void)
{ return right - left; }
_MACOBJ_INLINE Boolean CRect::EqualRect(const Rect& r) const
{ return ::EqualRect(this, &r); }
_MACOBJ_INLINE CPoint& CRect::TopLeft()
{ return *(CPoint*)this; }
_MACOBJ_INLINE CPoint& CRect::BottomRight()
{ return *((CPoint*)this+1); }
_MACOBJ_INLINE void CRect::UnionRect(Rect& r1, Rect& r2)
{ ::UnionRect(&r1,&r2,this); };
_MACOBJ_INLINE void CRect::SectRect(Rect& r1, Rect& r2)
{ ::SectRect(&r1,&r2,this); };
_MACOBJ_INLINE void CRect::operator=(const Rect& r)
{ (*(Rect*)this) = r; }
_MACOBJ_INLINE Boolean CRect::operator==(const Rect& r) const
{ return ::EqualRect(this, &r); }
_MACOBJ_INLINE Boolean CRect::operator!=(const Rect& r) const
{ return !::EqualRect(this, &r); }
_MACOBJ_INLINE void CRect::operator+=(Point p)
{ ::OffsetRect(this,p.h,p.v); }
_MACOBJ_INLINE void CRect::operator-=(Point p)
{ ::OffsetRect(this,-p.h,-p.v); }
_MACOBJ_INLINE void CRect::operator&=(const Rect& r)
{ ::SectRect(this,&r,this); }
_MACOBJ_INLINE void CRect::operator|=(const Rect& r)
{ ::UnionRect(this,&r,this); }
_MACOBJ_INLINE CRect CRect::operator+(Point p) const
{ CRect r(*this); ::OffsetRect(&r, p.h, p.v); return r; }
_MACOBJ_INLINE CRect CRect::operator-(Point p) const
{ CRect r(*this); ::OffsetRect(&r, -p.h, -p.v); return r; }
_MACOBJ_INLINE CRect CRect::operator|(const Rect& r) const
{ CRect r1; ::UnionRect(&r, this, &r1); return r1; }
_MACOBJ_INLINE CRect CRect::operator&(const Rect& r) const
{ CRect r1; ::SectRect(&r, this, &r1); return r1; }
_MACOBJ_INLINE void CRect::EraseRect()
{ ::EraseRect(this); }
_MACOBJ_INLINE void CRect::FillRect(PatPtr thePat)
{ ::FillRect(this, (const unsigned char*)thePat); }
_MACOBJ_INLINE void CRect::FrameRect()
{ ::FrameRect(this); }
_MACOBJ_INLINE void CRect::InvertRect()
{ ::InvertRect(this); }